<include file="default_header"/>

<body>
<div class="wraper">
    <div class="header bg-blue">
        <p class="iconfont icon-iconfontlaoshifengcai"></p>
        <p>登录</p>
        <a href="javascript:history.back(-1)" class="back"><img src="/assets/base/center/images/return.png"/></a>
    </div>
    <div class="container">
        <div class="form-list margin-b clearfix">
            <span class="field pull-left">账 号</span>
            <input class="form-control pull-left" placeholder="请输入您的学号/工号" id="number_container" value=""/>
            <p class="tips-icon">
                <span class="iconfont icon-zhengque icon-green" id="right"></span>
                <span class="iconfont icon-cuowu icon-red" id="wrong"></span>
            </p>
        </div>
        <div class="form-list margin-b clearfix">
            <span class="field pull-left">密 码</span>
            <input type="password" class="form-control pull-left" placeholder="请输入您的密码" id="pwd_container" value=""/>
            <p class="tips-icon">
                <span class="iconfont icon-zhengque icon-green" id="right"></span>
                <span class="iconfont icon-cuowu icon-red" id="wrong"></span>
            </p>
        </div>

        <p class="tips validation-tips margin-b"></p>
        <div class="btn-box margin-b">
            <a href="javascript:void(0);" class="btn register">提交</a>
        </div>

    </div>
    <input type="hidden" id="type" value="1">
    <if condition="$remark">
        <include file="remark"/>
    </if>
    <div class="bottom-box">
        <p class="copyright">杭州青橄榄网络技术有限公司 技术支持</p>
    </div>
</div>

<include file="common_js"/>

<script type="text/javascript">
    var height = $(window).height();
    var bottombox_height = $('.bottom-box').outerHeight();
    $('.wraper').css("minHeight", height);
    $('.wraper').css("paddingBottom", bottombox_height);

    $(document).on('click','.register',function(){
        var data = {};
        data.sn = $.trim($('#number_container').val());
        data.pwd = $.trim($('#pwd_container').val());

        if (!data.sn) {
            $('.validation-tips').html('账号不能为空').show();
            return false;
        } else if(!data.pwd) {
            $('.validation-tips').html('密码不能为空').show();
            return false;
        }

        $.ajax({
            method: 'post',
            type: 'json',
            url: "{BEESCRM::U('/base/User/doOauth',array('account_id'=>$accountId ,'type' => 1))}",
            dataType: 'json',
            data: data,
            success: function(json) {
                if (json.err_code == '200') {
                    $.alert('success','认证成功！');
                    reload();
                } else {
                    $.alert('error',json.msg);
                    return false;
                }
            }
        });
    });
    function reload(){
        location.href="{BEESCRM::U('/Meeting/Meeting/uCenter',array('account_id'=>$accountId))}";
    }
</script>
</body>
</html>